import React, { useState } from "react";

const BasicReact: React.FC<any> = ({
  onClick,
  name,
  slot1,
}) => {
  const [count, setCount] = useState(0);
  return (
    <div>
      <h2>这是一个 React 组件</h2>
      <p onClick={()=>{
        setCount(count + 1);
      }}>Hello from React! {count}</p>
      <button onClick={() => {
        console.log('name', name);
        onClick(count)
      }}>Click me</button>
      {slot1()}
    </div>
  );
};
export default BasicReact;
